import { api } from './baseRequest';

// 微信用户相关API
export const wechatSubscriberApi = {
  // 获取用户分页列表
  getSubscriberList: async (page, pageSize, keyword, subscribeStatus) => {
    try {
      return await api.get('/wechat/subscriber/list', {
        params: { page, pageSize, keyword, subscribeStatus }
      });
    } catch (error) {
      console.error('获取用户列表失败:', error);
      // 返回模拟数据作为降级方案
      return {
        records: [],
        total: 0,
        size: 10,
        current: 1,
        orders: [],
        pages: 0
      };
    }
  }
};

export default wechatSubscriberApi;